home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / basic / vect.zip / DOC.TXT < prev    next >
Text File  |  1992-06-04  |  3KB  |  89 lines

  1.                  A Couple Notes On 3DEXP2.BAS
  2.                       By Rich Geldreich
  3.  
  4.      3DEXP2.BAS is made in QuickBASIC 4.5, and requires at
  5. least a VGA adaptor to run properly(or at all, for that
  6. matter). It demonstrates fast, integer math rotation &
  7. perspective algorithms. It's really hard to believe that the
  8. sample program is actually written in QuickBASIC. Of course,
  9. if these routines were made in true assembly, the results
  10. would be much faster, to say the least. (Please compile the
  11. QB program for the best speed. DOS 5's QBASIC works fine
  12. too[rather slowly though...] If you don't have QBASIC or QB
  13. 4.5, then run the already compiled 3DEXP2.EXE to get an
  14. idea...)
  15. ═════════════════════════════════════════════════════════════
  16.    I am placing this program into the public domain, so use
  17. and abuse this program as much as you want, I don't care. All
  18. I ask is that you PLEASE keep my name on it! If you do change
  19.      it a little, then put "modifications by so & so" or
  20.  something. I have put a lot of work into making this program
  21.  fast and I don't won't to be ripped off by some lame, code-
  22.              stealing theif! Thank you very much.
  23. ═════════════════════════════════════════════════════════════
  24.  
  25.      The following is a short explanation of the perspective
  26. routine that 3DEXP2.BAS uses(the rotating routines are
  27. simple to understand once you understand the way sine and
  28. cosine operate...)
  29.  
  30.      The perspective routine I used is (usually) very
  31. realistic. It actually draws a line from the point that we
  32. wish to put into perspective to the user- wherever this line
  33. crosses the "viewing" plane (or the monitor) is where we
  34. actually plot the point.  (make pretend that this line we
  35. draw is actually a light ray... it's actually quite obvious
  36. and easy to understand once you see it...)
  37.  
  38.      Here are the formulas:
  39.  
  40. Xnew = Xold + ( -Xold * Spos - Z )
  41.                         --------
  42.                         Mpos - Z
  43.  
  44. Ynew = Yold + ( -Yold * Spos - Z )
  45.                         --------
  46.                         Mpos - Z
  47.  
  48. Where Xold and Yold and Z are the original coordinates to be
  49. put into perspective; Xpos is the Z coordinate of the
  50. "viewing" plane and Mpos is the Z coordinate of the
  51. user(which is usually 0).
  52.  
  53.  
  54. For the most speed, I highly recommend that you avoid
  55. floating point math whenever possible. It's great for
  56. initialization routines, but it really sucks in tight loops
  57. and high speed 3-D graphics.
  58.  
  59. For any questions, comments, or cool ideas, contact:
  60.  
  61. Rich Geldreich
  62. 410 Market St.
  63. Gloucester City, NJ 08030
  64. (609)-742-8752 between 4:30pm and 9:30pm Monday-Saturday
  65.  
  66.  
  67. ****Last Minute Additions
  68.  
  69. 3DEXP2.BAS really flickers a lot... I didn't use page flipping
  70. because I needed 64 colors.
  71.  
  72. I've also included some fast assembly code to rotate and display 
  73. 3-D points. It's called VECT.ASM. It's documented, but not
  74. that much. It rotates 765 points at 12 frames per second on by 286-10.
  75. This jem looks really cool in the dark! VECT.ASM is public domain too! 
  76. Works only on VGA. The keys recognized are similar to the keys 
  77. used by 3DEXP2.BAS.
  78.  
  79. Have fun and look both ways before crossing the street :-)
  80.  
  81.  
  82. R. Geldreich 
  83. June 4th, 1992A.D. 18:13:27
  84.  
  85.  
  86.  
  87.  
  88.  
  89.